feat(ui5-user-settings): add UserSettingsAppearanceView components#12739
Conversation
|
🧹 Preview deployment cleaned up: https://pr-12739--ui5-webcomponents.netlify.app |
| * Fired when a theme is selected. | ||
| * @public | ||
| */ | ||
| @event("theme-selected") |
There was a problem hiding this comment.
as discussed we can check with the core team about the naming of this event
| * @public | ||
| */ | ||
| @property() | ||
| selectedItemKey = ""; |
There was a problem hiding this comment.
its better to remove this property and use the selected property of the appearance items.
Check for reference UserSettingsDialog and UserSettingsItem - the same logic applies there
| @slot({ | ||
| type: HTMLElement, | ||
| }) | ||
| additionalContent?: Array<HTMLElement>; |
There was a problem hiding this comment.
maybe only content (again check with the core team)
There was a problem hiding this comment.
I set it to additionalContent, because it is not the default slot while content might lead to users thinking it is the default slot.
| this._getAllItems().forEach(item => { | ||
| item.selected = item.itemKey === this.selectedItemKey; | ||
| }); | ||
| } |
There was a problem hiding this comment.
THis might be removed when selected of the items is utilizaed
| return allItems; | ||
| } | ||
|
|
||
| _handleItemSelected = (e: CustomEvent) => { |
There was a problem hiding this comment.
give a type of the custom event. In that way the item will have type and no casting will be needed. Check again settings item:
e: CustomEvent
| * @public | ||
| */ | ||
| @property() | ||
| itemKey = ""; |
There was a problem hiding this comment.
when you remove the selected item key maybe this will be remove as well
There was a problem hiding this comment.
This is used to determine the theme
|
please update the demo samples: packages/website/docs/_samples/fiori/UserSettingsDialog/Basic/sample.html and packages/website/docs/_samples/patterns/UXCIntegration/Basic/sample.html |
Thanks for the reminder. |
|
🎉 This PR is included in version v2.18.0-rc.1 🎉 The release is available on v2.18.0-rc.1 Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version v2.18.0 🎉 The release is available on v2.18.0 Your semantic-release bot 📦🚀 |
The change introduces three new components - UserSettingsAppearanceView, UserSettingsAppearanceViewItem, and UserSettingsAppearanceViewGroup - designed to simplify building theme/appearance selection within the
UserSettingsDialog. They follow the latest design guidelines and provide a ready-to-use appearance settings view that can be easily integrated or extended.Overview
The
UserSettingsAppearanceViewcomponents provide a prebuilt theme selection interface for theUserSettingsDialog, simplifying implementation and delivering a structured, predefined layout for presenting theme options with visual indicators and grouping capabilities.Structure
UserSettingsAppearanceView(ui5-user-settings-appearance-view) is an extension ofUserSettingsViewthat offers a ready-to-use, fixed appearance selection design aligned with the latest UI patterns, ensuring a consistent user experience for theme management.UserSettingsAppearanceViewItem(ui5-user-settings-appearance-view-item) extendsListItemCustomto represent individual theme options with avatar icons, text labels, and selection states.UserSettingsAppearanceViewGroup(ui5-user-settings-appearance-view-group) extendsListItemGroupto organize related themes under descriptive headers.API
UserSettingsAppearanceView
Extends:
UserSettingsViewProps
Slots
Events
selection-change - Fired when a theme item is selected
detail.item: UserSettingsAppearanceViewItem - The selected appearance view item
cancelable: true - Event can be prevented with preventDefault()
UserSettingsAppearanceViewItem
Extends:
ListItemCustomProps
UserSettingsAppearanceViewGroup
Extends:
ListItemGroupProps
Slots
items!: Array - Appearance items within the group (default slot)
Test Pages
fiori/test/pages/UserSettingsDialog.html